<!DOCTYPE html>
<HTML>
<HEAD>
    <TITLE> ZTREE DEMO - Simple Data</TITLE>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="/zTree_v3/css/demo.css" type="text/css">
    <link rel="stylesheet" href="/zTree_v3/css/metroStyle/metroStyle.css" type="text/css">
    <script type="text/javascript" src="/zTree_v3/js/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="/zTree_v3/js/jquery.ztree.core.js"></script>
    <script type="text/javascript" src="/zTree_v3/js/jquery.ztree.excheck.js"></script>
    <script type="text/javascript" src="/zTree_v3/js/jquery.ztree.exedit.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.form/4.2.2/jquery.form.min.js" integrity="sha384-FzT3vTVGXqf7wRfy8k4BiyzvbNfeYjK+frTVqZeNDFl8woCbF0CYG6g2fMEFFo/i" crossorigin="anonymous"></script>



    </SCRIPT>
</HEAD>

<BODY STYLE="background-color:#F0F6E4;">
<div style="padding:10px;">
    <h1>用户名称：${userInfo.username}</h1>
</div>
<hr style="height:1px;border:none;border-top:1px solid #555555;" />
<div style="padding:10px;">
    <form id="myForm" action="/user/editUserRole" method="post">
        <input id="uid" name="uid" type="hidden" value="${userInfo.id}"/><br/>
        <%
        for(role in roleList)
        {
            if(role.id == rid)
            {
                print('<input name="rid" checked  type="radio" value="'+role.id+'"/> '+role.roleName + '<br/>');
                continue;
            }
            print('<input name="rid"  type="radio" value="'+role.id+'"/> '+role.roleName + '<br/>');
        }
        %>


    </form>
</div>
<a href="/user/editUserRolePage?id=${userInfo.id}">刷新</a>

<div>
    <button id="myButton" type="button" class="btn btn-primary">Submit - 提交</button>&nbsp;&nbsp;
    <a href="/user/listPage"><button id="backButton" type="button" class="btn btn-default">返 回</button></a>
</div>
<div id="msgDiv" style="float:left;color:red;padding-left:10px;"></div>




<script>
$("#myButton").click(function(){
    $("#myForm").ajaxSubmit({
			success: function (data) {
				if (data.resCode == 1){
					$("#msgDiv").text(data.resMsg);
				}
			},
			error: function () {
				$("#msgDiv").text("系统出现错误，请联系管理员");
			}
		});
});

</script>
</BODY>
</HTML>